package br.com.peri.repository;

import java.io.Serializable;
import java.util.List;

import org.hibernate.Session;

import br.com.peri.entity.PeriEntity;
import br.com.peri.exception.PeriRepositoryException;

public interface PeriRepository extends Serializable {

	<E extends PeriEntity> E salvar(E entity)
			throws PeriRepositoryException;

	<E extends PeriEntity> E atualizar(E entity)
			throws PeriRepositoryException;

	<E extends PeriEntity> void excluir(E entity)
			throws PeriRepositoryException;

	<E extends PeriEntity> void excluir(Class<E> clazz, Object id);

	<E extends PeriEntity> E pesquisarPorId(Class<E> clazz, Object id);

	<E extends PeriEntity> List<E> pesquisarPorParamentros(E entity);

	<E extends PeriEntity> List<E> listarTodos(Class<E> clazz);

	void flushAndClear();

	Session getSession();
}
